package BogoCDialogs;

sub new
{
	my $class = shift;
	my $self = bless{
		INPUTMSG=>undef,
		OUTGOING=>undef,
		CLIENTCMDS=>undef,
		SERVERCMDS=>undef,
		HEADER=>BogoHeader->new() 
		}, $class;
}
sub connsetup{
	my $self = shift;
	my %dataset;
	print "Welcome to Bogo Debugging Client\n=============================\n";
	print "Please enter host, you wish to connect:";
	$| = 1; # force a flush after our print
	$_ = <STDIN>; # get the input from STDIN (presumably the keyboard)

 	chomp;
 	
	$dataset{'host'}=$_;
	print "Please enter port:";
	chomp($dataset{'port'}=<>);
	print "Enter timeout:";
	chomp($dataset{'timeout'} = <>);
	print "Enter Client ID:";
	chomp($dataset{'clientId'} = <>);
	
	
	return %dataset;
}

sub printMsg{
	my $self = shift;
	my $msg  = shift;
	$msg->printHeader();
	
}

sub test{
	my $clientId = shift;
	
	my $bmsg = BogoMsg->new();
	my $bheader = BogoHeader->new();
	
	$bheader->sethdata(13, 12225666, 'READY', 32096);
	$bmsg->setHeader($bheader);
	$bmsg->printHeader();
}

use BogoCommands;
my $cmds = CHandler->new;

sub createMsg{
	my $self = shift;
	my $cmd = shift;
	
	my $msg = BogoMsg->new();
	$msg->setHeader($self->{HEADER});
	my $content = $cmds->{COMMANDS}{$cmd}();
	$msg->setContent($content);
	return $msg;
}


1;